home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1997 May / PC Plus Super CD Issue 127 (May 1997).iso / delphi1 / lessons.exe / lesson2 / VATCALC.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-07-07  |  578 b   |  23 lines

  1. unit Vatcalc;
  2. { Calculates UK Value Added Tax at 17.5%. Can easily be changed to calculate
  3.   other countries' taxes too, of course! } 
  4. interface
  5.  
  6. procedure PlusVat( var subtot, vattot, grandtot : real );
  7. procedure MinusVat( var subtot, vattot, grandtot : real );
  8.  
  9. implementation
  10. procedure PlusVat( var subtot, vattot, grandtot : real );
  11. begin
  12.    vattot := (subtot * 0.175);
  13.    grandtot := vattot + subtot;
  14. end;
  15.  
  16. procedure MinusVat( var subtot, vattot, grandtot : real );
  17. begin
  18.    vattot := (grandtot * 0.14894);
  19.    subtot := grandtot - vattot;
  20. end;
  21.  
  22. end.
  23.